/*
 * @Author: tianz 
 * @Date: 2018-11-16 11:27:19 
 * @Last Modified by: tianz
 * @Last Modified time: 2018-11-16 13:38:24
 * 
 * @Description: 测试WebServer类
 */



#include "webServer.h"

int main()
{
    try
    {
        std::string addr = "http://0.0.0.0:8080/test";
        PTLR::WebServer webServer(addr);

        webServer.open().wait();
        ucout << "Listening for requests at: " << addr << std::endl;
        ucout << "Press ENTER key to quit..." << std::endl;
        
        std::string line;
        std::getline(std::cin, line);
        webServer.close().wait();
    }
    catch (std::exception& ex)
    {
        ucout << "Exception: " << ex.what() << std::endl;
        ucout << "Press ENTER key to quit..." << std::endl;
        std::string line;
        std::getline(std::cin, line);
    }
    return 0;   
}